#include <bits/stdc++.h>

using namespace std;
int arr[1000];
int discrete(int n)
{
    sort(arr+1,arr+n+1);
    int m=unique(arr+1,arr+n+1)-(arr+1);
    return m;
}
int query(int x,int m)
{
    return lower_bound(arr+1,arr+m+1,x)-arr;
}
int main_18()
{
    srand(12);
    int num=rand()%50;
    for (int i=1;i<=num ;++i )
    {
        arr[i]=rand()%100000;
    }
    for (int i=1;i<=num ;++i )
    {
        printf("%d ",arr[i]);
    }
    printf("\n");
    int len=discrete(num);
    for (int i=1;i<=len ;++i )
    {
        printf("%d ",arr[i]);
    }
    printf("\n");
    printf("%d",query(5628,len));
    return 0;
}
